﻿@model IEnumerable<IGrouping<int, OJS.Web.Areas.Administration.ViewModels.AntiCheat.SubmissionSimilarityViewModel>>

@foreach (var groupedReport in Model.OrderBy(m => m.First().ProblemName))
{
    var sortedAndFilteredReports = groupedReport.Where(s => s.Points > 20).OrderBy(p => p.Percentage).Take(500);
    <h3 class="text-white">@groupedReport.First().ProblemName</h3>
    <table class="table table-striped">
        <tr>
            <th>
                First Participant
            </th>
            <th>
                Second Participant
            </th>
            <th>
                Points
            </th>
            <th>
                Differences
            </th>
            <th>
                Percentage
            </th>
        </tr>
        @foreach (var report in sortedAndFilteredReports)
	    {
		    <tr>
                <td>
                    <a href="/Contests/Submissions/View/@report.FirstSubmissionId" target="_blank">@report.FirstParticipantName - @report.FirstSubmissionCreatedOn</a>
                </td>
                <td>
                    <a href="/Contests/Submissions/View/@report.SecondSubmissionId" target="_blank">@report.SecondParticipantName - @report.SecondSubmissionCreatedOn</a>
                </td>
                <td>
                    @report.Points
                </td>
                <td>
                    @report.Differences
                </td>
                <td>
                    @report.Percentage
                </td>
		    </tr>
	    }
    </table>
    <br />
}